<!-- Showcase List { -->
<div class="panel-left">
	
	<?
		file_exists('includes/slider.php');
		include('includes/slider.php');
	?> 
	
<?
	$rs = $db->query("SELECT * FROM ".$prefix."loaisanpham where c_hienthi = 1 AND c_id_cha = 0");
	while($row = $db->fetch_array($rs)){
		$c_ten = stripcslashes($row[c_ten]);
		$c_id = $row[c_id];		
		//Lay danh sach cac id subcat
		$listId = layDanhSachSubCatId($c_id);
		$rs2 = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_hienthi = 1 AND t_loaisanpham IN(".$listId.")ORDER BY t_id DESC LIMIT 1");

		if($db->num_rows($rs2) != 0){
		$row2 = $db->fetch_array($rs2);
		$t_id = $row2[t_id];
		$t_tieude = stripslashes($row2[t_tieude]);
		$t_hinhanh = $row2[t_hinhanh];
		$t_mota = stripslashes($row2[t_mota]);
		$t_giacu = stripslashes($row2[t_giacu]);
		$t_giaban = stripslashes($row2[t_giaban]);
		$t_tinhthanh = layTinhThanh($row2[t_tinhthanh]);
		$t_loaitien = loadLoaiTien($row2[t_loaitien]);
		$t_nguoidang = $row2[t_nguoidang];
		$t_ten_nguoidang = tenNguoiDung($t_nguoidang);
?>
<!-- showcase { -->

<div class="showcase">	
	<h3 class="top">
		<a class="title" href="<?=$root?>/danh-muc-san-pham/<?=$c_id?>/<?=$myString->vietdecode($c_ten)?>" title="<?=$c_ten?>"><?=$c_ten?></a>
		<a class="btnviewmore" href="<?=$root?>/danh-muc-san-pham/<?=$c_id?>/<?=$myString->vietdecode($c_ten)?>">Xem thêm</a>
	</h3>
	<ul class="showcase-inside">

		<?
			$rs3 = $db->query("SELECT * FROM ".$prefix."sanpham WHERE t_hienthi = 1 AND t_loaisanpham IN(".$listId.") order by t_id DESC LIMIT 4");
			$t = 0;
			while($row3 = $db->fetch_array($rs3)){
			$t++;
			$s_t_id = $row3[t_id];
			$s_t_tieude = stripslashes($row3[t_tieude]);
			$s_t_giaban = stripslashes($row3[t_giaban]);
			$s_t_loaitien = loadLoaiTien($row3[t_loaitien]);
			$s_t_ten_nguoidang = tenNguoiDung($t_nguoidang);
			$s_t_hinhanh = $row3[t_hinhanh];
		?>

		<li class="product">
			<div class="pic">
				<a href="<?=$root?>/chi-tiet-san-pham/<?=$t_id?>/<?=$myString->vietdecode($t_tieude)?>">
				<img width="130px" height="130px" src="<?=$root?>/<?=$PathThumbFile?><?=$s_t_hinhanh?>" alt="<?=$t_tieude?>" onerror="this.src='<?=$root?>/themes/images/noimg.jpg';"/></a>
			</div>
			<div class="name-product">
				<a title="<?=$s_t_tieude?>" href="<?=$root?>/chi-tiet-san-pham/<?=$s_t_id?>/<?=$myString->vietdecode($s_t_tieude)?>"><?=$s_t_tieude?></a>
			</div>
			<p class="price"><?=showprice($s_t_giaban)?> <?=$s_t_loaitien?></p>
		</li>
		<? } ?>	
	</ul>
</div>
	
<!-- } showcase -->

<? }//end if($db->num_rows($rs2)) ?>		
<? } ?>        

<div class="clear-showcase"></div>
     
				<!-- } Showcase List -->
</div>
    